#include <stdio.h>

int main(void){
	int a[10],temp = 0;
	printf("请输入10个数字："); 
	for(int i = 0; i < 10; i++){
		scanf("%d",&a[i]);
	} 
	int min = a[0];
	int max = a[9];
	int *pmax = a;
	int *pmin = a + 9;
	for(int i = 0; i < 10; i++){
		if(a[i] < min){
			min = a[i];
			pmin = &a[i]; 
		}
		if(a[i] > max){
			max = a[i];
			pmax = &a[i];
		}
	}
	temp = a[0];
	a[0] = *pmin;
	*pmin = temp;
	temp = a[9];
	a[9] = *pmax;
	*pmax = temp;
	printf("输出为：");
	for(int i = 0; i < 10; i++){
		printf("%d\t",a[i]);
	}
	return 0;
} 
